const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    title: { type: String },
    type: { type: String },
    category: [{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Category'
    }],
    time: { type: String },
    body: { type: String }
}, {
    timestamp: true
})

module.exports = mongoose.model('Article', schema, 'articles')
